﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace ELab.Serialization.Data
{
    [XmlRoot("Surveys")]
    public class Survey : IELabSerializable
    {
        [XmlElement("ID")]
        public int ID { get; set; }

        [XmlElement("Question")]
        public string Question { get; set; }

        [XmlElement("Answer")]
        public string Answer { get; set; }

        public void Serialize(IELabSerializer serializer)
        {
            serializer.WriteInt32(ID);
            serializer.WriteStringUTF8(Question);
            serializer.WriteStringUTF8(Answer);
        }

        public void Deserialize(IELabDeserializer deserializer)
        { 
            ID =deserializer.ReadInt32();
            Question = deserializer.ReadStringUTF8();
            Answer = deserializer.ReadStringUTF8();
        }
    }
}
